1. Field of the Invention
The present invention relates to a method for writing data blocks on a block addressable storage medium, preferably an optical storage medium, using defect management. The invention also relates to a computer program, a computer program product and an apparatus for writing data blocks on a block addressable storage medium.
2. Description of Prior Art
Rewritable recording media such as magneto-optical discs, phase-change discs (DVD-RAM, etc.), hard discs and the like may have defects on their recording surfaces. The defects may be the result of e.g. an initial failure caused during the time of shipment of the recording media from the factories to the customers, a flaw or blemish arising during the storage or usage of the recording media, or any deterioration caused by the usage of the recording media.
The existence of such a defect on the recording surface of the recording medium may cause a failure in the secure data recording. In view of this, in the art of rewritable recording media, a technique of detecting a defect on the recording surface face of a recording medium and recording the data at a position different from the position of the defect has been employed. Such a technique is generally referred to as “defect management”.
Specifically, once the disc drive received an instruction to record the data into a data area on the recording surface of the recording medium from the host processor (e.g. a main controller/processor of a DVD-recorder), the disc drive first records the data into the specified sector in the data area. If it is determined that the sector is in the defective condition due to a defect on the recording surface, the disc drive records the same data including the same contents of the just recorded data into a spare area on the recording surface of the recording medium. That is, the spare area is disposed on the recording surface of the recording medium at a location different from the data area, which is for the normal recording of the data. Hence, in case of a failure to properly record the data into a certain sector in the data area due to a defect on the recording surface, the data is recorded into the spare area. Thereby, even in the case of a defective area, a loss of the data may be avoided.
In the art there are different techniques to record data and to perform a defect management.
In the “host based defect management”, the host is doing the defect management alone. It can record data at optimal sped, but then has to verify that the data has actually been written correctly (usually the verification is done through a read command and comparing the data returned to the read command to the data written, or through a verify MMC (multimedia commands specification from INCITS T10) command; To record data at optimal speed, the recording procedure needs to be performed uninterrupted, so the verification phase can occur only after the recording. The host then needs huge amount of memory (up to the media capacity) to ensure it can handle defects for all the data recorded. If the host wants to limit its memory usage to a reasonable amount, then the host has to interrupt writing by verification before all the data is written, and this apparently does not result in an optimal recording performance. Additionally, it is uneasy and time consuming for the host to find light defects (defects that are automatically recovered by the target through error correction code placed on the media) and to decide whether it has to move data from the area having this light defect to a spare area or not. Finally, the file system used must be capable of handling defect management, like the UDF 1.50 file system, and this limits the choice of file system (the FAT file system does not support defect management).
In the “target-based defect management”, the target is doing the defect management alone (“target” normally specifies the controller receiving multimedia commands from the host and directly driving the disc drive to read and write data from/to the storage medium). If the target chooses to perform a verification procedure after a write procedure (called: write by verification) to find a defect area or spot, because the target has access to limited memory, the target has to interrupt the write by verification procedure often, before the written data is out of its size limited memory. The target can also perform a certification of the media or a part of the media to find defective spots before writing to the media. However, the target is not granted to have time to certify the entire medium before the writing procedure caused by the host begins, and the certification information cannot be guaranteed valid once the media is ejected from the target (user could put his fingers on the media for instance, causing new defective spots, or could clean the media, potentially repairing previous defective spots). Additionally, if a defect is found (by verification) or known by the target (by certification) but written by the host, the device is unable to grant any streaming, because the data needs to be moved immediately to spare area, with the possibility that the spare area itself is defective, meaning that there is a possible recursion.
In the art, also a “host and target based defect management” exists. It is named “logical unit assisted software defect management model (persistent-DM and DRT-DM) and it is described in the MMC specification and the Mt Fuji (Mt Fuji commands for multimedia devices from SFF committee; ftp://ftp.avcpioneer.com/Mtfuji5/Spec/Fuji5rl6.zip) specification. However, this defect management technique requires that the host is maintaining the defect management information (performs “management” as defined in the mentioned model), increasing the complexity of the host implementation, and limiting the choice of file system. This technique also requires relative complex information to be transmitted between host and target to describe the defective spots. Finally, this technique does not allow the host to compute the image of the data it has to burn “at once”, because the host has to recomputed and possibly change the file System information after it retrieved from the host the defective spots information.
The above-mentioned solutions for defect management suffer from the fact that they are not able to ideally perform both defect management and optimal recording performance. This is true primarily for optical recording technology since it suffers both from frequent media defect and from additional seeking time which occurs during defect management.